﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ppt = Microsoft.Office.Interop.PowerPoint;

namespace ObjectModel.PowerPoint.New
{
    public class ResolvableTableCell : ResolvableObject
    {
        public ResolvableShape Shape { get; set; }
        public int Row { get; set; }
        public int Column { get; set; }

        public ResolvableTableCell() { } // Parameterless constructor required for deserialization.

        public ResolvableTableCell(Ppt.Table table, int row, int col)
        {
            Shape = new ResolvableShape(table.GetParent<Ppt.Shape>());
            Row = row;
            Column = col;
        }

        public override object Resolve()
        {
            Ppt.Shape shape = Shape.Resolve() as Ppt.Shape;
            return shape.Table.Cell(Row, Column);
        }
    }
}
